package cn.pdx.elec.web.action;


import java.util.List;

import cn.pdx.elec.container.ServiceProvider;
import cn.pdx.elec.service.ElecLogService;
import cn.pdx.elec.web.form.ElecLogForm;
import com.opensymphony.xwork2.ModelDriven;


/**
 * implements ModelDriven<T>实现这个接口，泛型
 * ModelDriven<ElecUserForm>表示这个表单对象
 * @author 彭定旭
 *
 */
@SuppressWarnings("serial")
public class ElecLogAction extends BaseAction implements  ModelDriven<ElecLogForm>{
    
	/**
	 * 创建一个表单对象，对应页面的属性的对象
	 */
	private ElecLogForm elecLogForm=new ElecLogForm();
	
	/**
	 * 使用方法调用ElecLogService.SERVICE_NAME 接口
	 */
	@SuppressWarnings("unused")
	private ElecLogService elecLogService=(ElecLogService) ServiceProvider.getService(ElecLogService.SERVICE_NAME);

	public ElecLogForm getModel() {
		
		return elecLogForm;
	}
	 
	/**
	 * @Name:home
	 * @Description:主页面查询日志信息列表
	 * @author 彭定旭
	 * @Create Date:2013-4-25(创建日期)
	 * @return home,成功->logIndex.jsp   
	 */
	public  String home()
	{
		
		List<ElecLogForm> list=elecLogService.findElecLogListByCondition(elecLogForm);
		
		request.setAttribute("LogList", list);
		
		return "home";
	}
	
	
	/**
	 * @Name:delete
	 * @Description:删除主页面查询日志信息列表
	 * @author 彭定旭
	 * @Create Date:2013-4-25(创建日期)
	 * @return home,成功->logIndex.jsp   
	 */
	public  String delete()
	{
		
		elecLogService.deleteElecLogByLogIDs(elecLogForm);
		
		return "delete";
	}
	
	
}
